<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan= "http://xml.apache.org/xalan" exclude-result-prefixes="xalan">
	
    <xsl:include href="header.xsl"/>
    <xsl:include href="banner.xsl"/>
    <xsl:include href="utils.xsl"/>

	<!--
	main page
	-->
    <xsl:template match="/">
        <html>
            <head>
                <xsl:call-template name="header"/>
                <xsl:apply-templates mode="script" select="/"/>
            </head>
            <body onload="init()">
				<form id="excel_form" name="excel_form" target="_blank" action="/geonetwork/servlet/ExcelExportServlet" method="post">
					<input type="hidden" name="excel_html_content" id="excel_html_content" value="empty" />
					<input type="hidden" name="file_name" id="file_name" value="result.xls" />
				</form>
                <table width="100%" height="100%">

					<!-- banner -->
                    <tr>
                        <td>
                            <xsl:call-template name="banner"/>
                        </td>
                    </tr>

					<!-- content -->
                    <tr height="100%">
                        <td width="100%">
                            <xsl:call-template name="content"/>
                        </td>
                    </tr>
                </table>
                <table width="100%">
                    <tr>
                        <td class="content" align="right">
                            <img src="{/root/gui/url}/images/footer.jpg"/>
                        </td>
                    </tr>
                </table>
            </body>
        </html>
    </xsl:template>

    <xsl:template mode="script" match="/"/>

    <xsl:template name="formLayout">
        <xsl:param name="title"/>
        <xsl:param name="content"/>
        <xsl:param name="menu"/>
        <xsl:param name="buttons"/>
        <xsl:param name="indent" select="100"/>
        <div style="width: 100%">
        <xsl:call-template name="leftMenu">
            <xsl:with-param name="menu" select="$menu"/>
        </xsl:call-template>
        <div class="middle_column">
            <table  height="100%" width="100%">
                <!-- title -->
                <xsl:call-template name="formTitle">
                    <xsl:with-param name="title" select="$title"/>
                    <xsl:with-param name="indent" select="$indent"/>
                </xsl:call-template>
			<!-- content -->
                <xsl:call-template name="formContent">
                    <xsl:with-param name="content" select="$content"/>
                    <xsl:with-param name="indent" select="$indent"/>
                </xsl:call-template>

			<!-- buttons -->
                <xsl:if test="$buttons">
                    <xsl:call-template name="formSeparator"/>
                    <xsl:call-template name="formContent">
                        <xsl:with-param name="content" select="$buttons"/>
                        <xsl:with-param name="indent" select="$indent"/>
                    </xsl:call-template>
                </xsl:if>

			<!-- footer -->
                <xsl:call-template name="formFiller">
                    <xsl:with-param name="indent" select="$indent"/>
                </xsl:call-template>
                <tr>
                    <td class="blue-content" colspan="3"></td>
                </tr>

            </table>
        </div>
        <div style="background: url({/root/gui/url}/images/fondo.jpg); float: right; width: 150px; height: 500px">
        </div>
        </div>
    </xsl:template>

    <xsl:template name="formTitle">
        <xsl:param name="title"/>
        <xsl:param name="indent" select="100"/>

        <tr>
            <td class="padded-content" align="right">
                <span class="titulo">
                    <xsl:value-of select="$title"/>
                </span>
                <hr/>
            </td>
        </tr>
    </xsl:template>

    <xsl:template name="formContent">
        <xsl:param name="content"/>

        <tr>
            <td class="padded-content" align="center">
                <xsl:copy-of select="$content"/>
            </td>
        </tr>
    </xsl:template>

    <xsl:template name="formSection">
        <xsl:param name="title"/>
        <xsl:param name="indent" select="100"/>

        <tr>
            <td class="content" width="{$indent}" valign="bottom">
                <table width="100%">
                    <tr>
                        <td class="dots"/>
                    </tr>
                </table>
            </td>
            <td class="content" valign="bottom" colspan="2">
                <table width="100%">
                    <tr>
                        <td class="green-content">
                            <xsl:copy-of select="$title"/>
                        </td>
                        <td class="content" width="100%" valign="bottom">
                            <table width="100%">
                                <tr>
                                    <td class="dots"/>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </xsl:template>

    <xsl:template name="formSeparator">
        <tr>
            <td class="dots" colspan="3"/>
        </tr>
    </xsl:template>

    <xsl:template name="formFiller">
        <xsl:param name="indent" select="100"/>

        <tr height="100%">
            <td class="padded-content" width="{$indent}"/>
            <td class="dots"/>
            <td class="padded-content">
            </td>
        </tr>
    </xsl:template>

    <xsl:template name="leftMenu">
        <xsl:param name="menu"/>
        <div style="float: left; margin-left: 0px; width: 220px">
            <table class="geosearchmain" width="100%">  <!--height="100%">-->

                <tr>
				<!-- search -->
                    <xsl:comment>LEFT: search, minimap and news</xsl:comment>

                    <td class="padded-content" id="leftcolumn" width="224px">
                        <xsl:choose>
                            <xsl:when test="$menu='admin'">
                                <div style="background: transparent url({/root/gui/url}/images/login_bg.jpg) repeat-x scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: auto; white-space: nowrap; padding-bottom: 0px; vertical-align: bottom;">
                                    <table width="80%" align="center">
                                        <tr>
                                            <td height="50px">
                                                <br/>
                                                <img src="{/root/gui/url}/images/point.png" border="0"/>
                                                <b class="white" style="vertical-align: top">
                                                    <xsl:value-of select="/root/gui/strings/admin"/>....
                                                </b>
                                                <hr/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='group.list'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/groupManagement"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/group.list">
                                                            <xsl:value-of select="/root/gui/strings/groupManagement"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='user.list'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/userManagement"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/user.list">
                                                            <xsl:value-of select="/root/gui/strings/userManagement"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='user.infoedit'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/userInfo"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/user.infoedit?id=1">
                                                            <xsl:value-of select="/root/gui/strings/userInfo"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='user.pwedit'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/userPw"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/user.pwedit?id=1">
                                                            <xsl:value-of select="/root/gui/strings/userPw"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <br/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </xsl:when>
                            <xsl:when test="$menu='contentAdmin'">
                                <div style="background: transparent url({/root/gui/url}/images/login_bg.jpg) repeat-x scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: auto; white-space: nowrap; padding-bottom: 0px; vertical-align: bottom;">
                                    <table width="80%" align="center">
                                        <tr>
                                            <td height="50px">
                                                <br/>
                                                <img src="{/root/gui/url}/images/point.png" border="0"/>
                                                <b class="white" style="vertical-align: top">
                                                    <xsl:value-of select="/root/gui/strings/contentAdmin"/>....
                                                </b>
                                                <hr/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='category.list'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/categoryManagement"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/category.list">
                                                            <xsl:value-of select="/root/gui/strings/categoryManagement"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                            <tr>
                                                    <td>
                                                            <xsl:choose>
                                                                    <xsl:when test="/root/gui/reqService='organization.list'">
                                                                            <font class="banner-active">
                                                                                    <xsl:value-of select="/root/gui/strings/organizationManagement"/>
                                                                            </font>
                                                                    </xsl:when>
                                                                    <xsl:otherwise>
                                                                            <a class="banner" href="{/root/gui/locService}/organization.list">
                                                                                    <xsl:value-of select="/root/gui/strings/organizationManagement"/>
                                                                            </a>
                                                                    </xsl:otherwise>
                                                            </xsl:choose>
                                                    </td>
                                                    <!--td class="padded"><xsl:value-of select="/root/gui/strings/organizationManDes"/></td-->
                                            </tr>
                                            <tr>
                                                    <td>
                                                            <xsl:choose>
                                                                    <xsl:when test="/root/gui/reqService='area_category.update'">
                                                                            <font class="banner-active">
                                                                                    <xsl:value-of select="/root/gui/strings/categoryAreaManagement"/>
                                                                            </font>
                                                                    </xsl:when>
                                                                    <xsl:otherwise>
                                                                            <a class="banner" href="{/root/gui/locService}/area_category.update">
                                                                                    <xsl:value-of select="/root/gui/strings/categoryAreaManagement"/>
                                                                            </a>
                                                                    </xsl:otherwise>
                                                            </xsl:choose>
                                                    </td>
                                                    <!--td class="padded"><xsl:value-of select="/root/gui/strings/categoryAreaManDes"/></td-->
                                            </tr>
                                        <tr>
                                            <td>
                                                <br/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </xsl:when>
                        <!-- METADATOS -->
                            <xsl:when test="$menu='metadata'">
                                <div style="background: transparent url({/root/gui/url}/images/login_bg.jpg) repeat-x scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: auto; white-space: nowrap; padding-bottom: 0px; vertical-align: bottom;">
                                    <table width="80%" align="center">
                                        <tr>
                                            <td height="50px">
                                                <br/>
                                                <img src="{/root/gui/url}/images/point.png" border="0"/>
                                                <b class="white" style="vertical-align: top">
                                                    <xsl:value-of select="/root/gui/strings/metadata"/>
                                                </b>
                                                <hr/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='metadata.create.form'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/newMetadata"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/metadata.create.form">
                                                            <xsl:value-of select="/root/gui/strings/newMetadata"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='metadata.xmlinsert.form'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/xmlInsertTitle"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/metadata.xmlinsert.form">
                                                            <xsl:value-of select="/root/gui/strings/xmlInsertTitle"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='metadata.batchimport.form'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/batchImportTitle"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/metadata.batchimport.form">
                                                            <xsl:value-of select="/root/gui/strings/batchImportTitle"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='metadata.searchunused.form'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/searchUnusedTitle"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/metadata.searchunused.form">
                                                            <xsl:value-of select="/root/gui/strings/searchUnusedTitle"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='thesaurus.admin'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/thesaurus/management"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/thesaurus.admin">
                                                            <xsl:value-of select="/root/gui/strings/thesaurus/management"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
										<tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='metadata.duplicate'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/duplicate"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/metadata.duplicate">
                                                            <xsl:value-of select="/root/gui/strings/duplicate"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <br/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </xsl:when>
                        <!-- harvesting -->
                            <xsl:when test="$menu='harvesting'">
                                <div style="background: transparent url({/root/gui/url}/images/login_bg.jpg) repeat-x scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: auto; white-space: nowrap; padding-bottom: 0px; vertical-align: bottom;">
                                    <table width="80%" align="center">
                                        <tr>
                                            <td height="50px">
                                                <br/>
                                                <img src="{/root/gui/url}/images/point.png" border="0"/>
                                                <b class="white" style="vertical-align: top">
                                                    <xsl:value-of select="/root/gui/strings/ICDENode"/>
                                                </b>
                                                <hr/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='harvesting'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/harvestingManagement"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/harvesting">
                                                            <xsl:value-of select="/root/gui/strings/harvestingManagement"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='config'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/systemConfig"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/config">
                                                            <xsl:value-of select="/root/gui/strings/systemConfig"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <br/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </xsl:when>

                        <!-- consultas -->
                            <xsl:when test="$menu='search'">
                                <div style="background: transparent url({/root/gui/url}/images/login_bg.jpg) repeat-x scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: auto; white-space: nowrap; padding-bottom: 0px; vertical-align: bottom;">
                                    <table width="80%" align="center">
                                        <tr>
                                            <td height="50px">
                                                <br/>
                                                <img src="{/root/gui/url}/images/point.png" border="0"/>
                                                <b class="white" style="vertical-align: top">
                                                    <xsl:value-of select="/root/gui/strings/simple"/>
                                                </b>
                                                <hr/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='main.home'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/hideAdvancedOptions"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/main.home" onclick="showSimpleSearch2();">
                                                            <xsl:value-of select="/root/gui/strings/hideAdvancedOptions"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='main.home'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/extended"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/main.home" onclick="showAdvancedSearch()">
                                                            <xsl:value-of select="/root/gui/strings/extended"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <xsl:choose>
                                                    <xsl:when test="/root/gui/reqService='statistics.view'">
                                                        <font class="banner-active">
                                                            <xsl:value-of select="/root/gui/strings/statistics"/>
                                                        </font>
                                                    </xsl:when>
                                                    <xsl:otherwise>
                                                        <a class="banner" href="{/root/gui/locService}/statistics.view">
                                                            <xsl:value-of select="/root/gui/strings/statistics"/>
                                                        </a>
                                                    </xsl:otherwise>
                                                </xsl:choose>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <br/>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </xsl:when>

                            <xsl:otherwise>
                                OTRO
                            </xsl:otherwise>
                        </xsl:choose>
                                                                			<!-- login -->
                    </td>


                </tr>
            </table>
        </div>
    </xsl:template>
        
</xsl:stylesheet>
